package com.iwdnb.gkgz.ui.controller;

import java.util.List;
import java.util.concurrent.Executor;
import java.util.stream.Collectors;

import com.google.common.collect.Lists;
import com.iwdnb.bmnf.common.eventbus.EventBus;
import com.iwdnb.bmnf.common.model.result.Result;
import com.iwdnb.gkgz.application.event.StockAnalysisEventHandler;
import com.iwdnb.gkgz.application.event.StockBackValidateEventHandler;
import com.iwdnb.gkgz.application.model.request.AddStrategyTradeStockDataRequest;
import com.iwdnb.gkgz.application.service.StockService;
import com.iwdnb.gkgz.application.service.StrategyTradeService;
import com.iwdnb.gkgz.application.strategy.StockBackValidateService;
import com.iwdnb.gkgz.common.model.dto.Stock;
import com.iwdnb.gkgz.common.model.dto.StockDayData;
import com.iwdnb.gkgz.common.model.dto.StrategyTradeDTO;
import com.iwdnb.gkgz.common.utils.StockBlackListUtils;
import com.iwdnb.gkgz.infrastructure.dao.repo.StockDayDataRepository;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 策略交易分析
 */
@RestController
@RequestMapping("/api/stock/analysis")
public class StockAnalysisController {

    /**
     * 股票交易策略数据分析
     *
     * @param request
     * @return
     */
    @PostMapping(value = "/doStockAnalysis")
    public Result<Void> doAllBackValidate(@RequestBody AddStrategyTradeStockDataRequest request) {
        EventBus.sendEvent(StockAnalysisEventHandler.EVENT_TOPIC, request);
        return Result.getSuccessResult(null);
    }

}
